﻿CREATE TABLE [dbo].[FlightDetail] (
    [Id]                    INT      IDENTITY (1, 1) NOT NULL,
    [FlightId]              INT      NOT NULL,
    [DestinationId]         INT      NOT NULL,
    [AirplaneId]            INT      NOT NULL,
    [EstimateDepartureDate] DATETIME NULL,
    [ScheduleDepartureDate] DATETIME NULL,
    [RealDepartureDate]     DATETIME NULL,
    [EstimateArrivalDate]   DATETIME NULL,
    [ScheduleArrivalDate]   DATETIME NULL,
    [RealArrivalDate]       DATETIME NULL,
    CONSTRAINT [PK__CT_Chuye__8367D23756B0D837] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_FlightDetail_Airplane] FOREIGN KEY ([AirplaneId]) REFERENCES [dbo].[Airplane] ([Id]),
    CONSTRAINT [FK_FlightDetail_Destination] FOREIGN KEY ([DestinationId]) REFERENCES [dbo].[Destination] ([Id]),
    CONSTRAINT [FK_FlightDetail_Flight] FOREIGN KEY ([FlightId]) REFERENCES [dbo].[Flight] ([Id])
);

